﻿@model IEnumerable<Doan.Forum.Models.Category>
@{
    ViewBag.Title = "SubCateList";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<span class="left" style="width: 100%; margin-bottom: 20px;">
    <h4 class="label label-info" style="width: 30%; padding: 10px; font-size: 20px;">@ViewBag.ParentName</h4>
</span>

@foreach (var item in Model)
{
    switch (item.CategoriId % 6)
    {
        case 0: <div class="tile one limebg">
                    <a href=@Url.Action("TopicList", "Home", new {id= item.CategoriId})>
                        <div class="right rightcategory">
                            @item.Topics.Count Chủ đề
                            <br/>
                            @item.Topics.Select(x=>x.Comments.Count).Sum() Bình luận
                        </div>
                        <div class="left">
                            <img src=@Url.Content("../.."+item.Logo) alt=@item.CategoryName/>
                        </div>
                        <div style="width: 100%; float: left; margin-top: 10px;"><h4>@item.CategoryName</h4></div>
                    </a>
                </div>
            break;
        case 1: <div class="tile one orangebg">
                    <a href=@Url.Action("TopicList", "Home", new {id= item.CategoriId})>
                        <div class="right rightcategory">
                            @item.Topics.Count Chủ đề
                            <br/>
                            @item.Topics.Select(x=>x.Comments.Count).Sum() Bình luận
                        </div>
                        <div class="left">
                            <img src=@Url.Content("../.."+item.Logo) alt=@item.CategoryName/>
                        </div>
                        <div style="width: 100%; float: left; margin-top: 10px;"><h4>@item.CategoryName</h4></div>
                    </a>
                </div>
            break;
        case 2: <div class="tile one purplebg">
                    <a href=@Url.Action("TopicList", "Home", new {id= item.CategoriId})>
                        <div class="right rightcategory">
                            @item.Topics.Count Chủ đề
                            <br/>
                            @item.Topics.Select(x=>x.Comments.Count).Sum() Bình luận
                        </div>
                        <div class="left">
                            <img src=@Url.Content("../.."+item.Logo) alt=@item.CategoryName/>
                        </div>
                        <div style="width: 100%; float: left; margin-top: 10px;"><h4>@item.CategoryName</h4></div>
                    </a>
                </div>
            break;
        case 3: <div class="tile one seagreenbg">
                    <a href=@Url.Action("TopicList", "Home", new {id= item.CategoriId})>
                        <div class="right rightcategory">
                            @item.Topics.Count Chủ đề
                            <br/>
                            @item.Topics.Select(x=>x.Comments.Count).Sum() Bình luận
                        </div>
                        <div class="left">
                            <img src=@Url.Content("../.."+item.Logo) alt=@item.CategoryName/>
                        </div>
                        <div style="width: 100%; float: left; margin-top: 10px;"><h4>@item.CategoryName</h4></div>
                    </a>
                </div>
            break;
        case 4: <div class="tile one brownbg">
                    <a href=@Url.Action("TopicList", "Home", new {id= item.CategoriId})>
                        <div class="right rightcategory">
                            @item.Topics.Count Chủ đề
                            <br/>
                            @item.Topics.Select(x=>x.Comments.Count).Sum() Bình luận
                        </div>
                        <div class="left">
                            <img src=@Url.Content("../.."+item.Logo) alt=@item.CategoryName/>
                        </div>
                        <div style="width: 100%; float: left; margin-top: 10px;"><h4>@item.CategoryName</h4></div>
                    </a>
                </div>
            break;
        case 5: <div class="tile one tealbg">
                    <a href=@Url.Action("TopicList", "Home", new {id= item.CategoriId})>
                        <div class="right rightcategory">
                            @item.Topics.Count Chủ đề
                            <br/>
                            @item.Topics.Select(x=>x.Comments.Count).Sum() Bình luận
                        </div>
                        <div class="left">
                            <img src=@Url.Content("../.."+item.Logo) alt=@item.CategoryName/>
                        </div>
                        <div style="width: 100%; float: left; margin-top: 10px;"><h4>@item.CategoryName</h4></div>
                    </a>
                </div>
            break;
        default: <div class="tile one bluebg">
                     <a href=@Url.Action("TopicList", "Home", new {id= item.CategoriId})>
                         <div class="right rightcategory">
                             @item.Topics.Count Chủ đề
                             <br/>
                             @item.Topics.Select(x=>x.Comments.Count).Sum() Bình luận
                         </div>
                         <div class="left">
                             <img src=@Url.Content("../.."+item.Logo) alt=@item.CategoryName/>
                         </div>
                         <div style="width: 100%; float: left; margin-top: 10px;"><h4>@item.CategoryName</h4></div>
                     </a>
                 </div>
            break;
    }
}

